package ch.zbw.pra.sysventory.database.mapper;

import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;


import ch.zbw.pra.sysventory.model.OperatingSystem;

/**
 * Mapping von einem Resultset auf ein Operatingsystem Objekt
 * 
 * @author Roberto Lucas
 */

public class OperatingSystemMapper implements RowMapper<OperatingSystem>, Serializable {
	
	private static final long serialVersionUID = 4786168485959593394L;

	public OperatingSystem mapRow(ResultSet rs, int rowNum) throws SQLException {
		OperatingSystem operatingSystem = new OperatingSystem();
		operatingSystem.setOperatingSystemId(rs.getInt("operID_pk"));
		operatingSystem.setNameOperatingSystem(rs.getString("operName"));
		operatingSystem.setBuildOperatingSystem(rs.getString("operVersion"));
		operatingSystem.setArchitecture32Bit64BitOperatingSystem(rs.getString("operBit"));
		return operatingSystem;
	}

}
